Disjoint Bit Masks (DBM)

Description:

DBM issues a warning message if the result of a == or != comparison operator can be true only when both of the operands are zero. This is the case when the intersection of the bit masks of the operands is zero. (A bit mask indicates which bits of an operand are not constantly zero.)

Incorrect:

bool compare(int x, int y) {
    return (x & 1) == y * 2;
}